//
//  MenuScene.m
//  Soccer
//
//  Created by Hyun-Woong Kim on 09. 04. 22.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "MenuScene.h"
#import "LoadScene.h"
#import "GameScene.h"


@implementation MenuScene

- (id)init
{
	if (self = [super init])
	{
		[self addChild:[MenuLayer node] z:0];
	}
	return self;
}
@end

@implementation MenuLayer

- (id)init
{
	if (self = [super init])
	{
		bg = [Sprite spriteWithFile:@"iphone.png"];
		bg.transformAnchor = CGPointZero;
		[self addChild:bg];
		
		[MenuItemFont setFontName:@"Helvetica"];
		[MenuItemFont setFontSize:20];
		MenuItemFont *start = [MenuItemFont itemFromString:@"Start Game" target:self selector:@selector(startGame:)];
		[((MenuItemFont *)start).label setRGB:240 :12 :110];
		MenuItemFont *help = [MenuItemFont itemFromString:@"Help" target:self selector:@selector(help:)];
		[((MenuItemFont *)help).label setRGB:240 :12 :110];
		
		Menu *menu = [Menu menuWithItems:start, help, nil];
		[menu alignItemsVertically];
		[self addChild:menu];
	}
	return self;
}

- (void)startGame:(id)sender
{

	GameScene *gs = [GameScene node];
	[[Director sharedDirector] replaceScene: gs];
}

- (void)help:(id)sender
{
}

@end